/*
  @Time : 2019/11/4
  @Author : 6362
*/
package db

import (
	"github.com/go-redis/redis"
)

var Client *redis.Client

func init() {
	/*data := LoadConfig()
	if data == nil {
		log.Println("加载数据库配置信息异常:")
		return
	}
	//解密用户名和密码
	bytesPass, err := base64.StdEncoding.DecodeString(data.Redis.Password)
	if err != nil {
		fmt.Println(err)
		return
	}
	decPsssword, _ := common.AesDecrypt(bytesPass, common.Key)

	Client = redis.NewClient(&redis.Options{
		Addr:     data.Redis.Ip,
		Password: string(decPsssword),
		DB:       0,
	})

	pong, err := Client.Ping().Result()
	if err != nil {
		log.Printf("ping error[%s]\n", err.Error())
	}
	log.Printf("ping result: %s\n", pong)*/
}

func closeRedis() {
	Client.Close()
}
